<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>metagol &mdash; The Logtalk Handbook v3.93.0-b01 documentation</title>
      <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=d75fae25" />
      <link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />
      <link rel="stylesheet" type="text/css" href="../_static/css/custom.css?v=396eccfe" />

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../_static/jquery.js?v=5d32c60e"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
        <script src="../_static/documentation_options.js?v=c8100655"></script>
        <script src="../_static/doctools.js?v=9a2dae69"></script>
        <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../_static/js/theme.js"></script>
    <!-- begin favicon -->
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
    <link rel="manifest" href="/site.webmanifest" />
    <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
    <meta name="msapplication-TileColor" content="#355b95" />
    <meta name="theme-color" content="#ffffff" />
    <!-- end favicon -->
    
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="toychr" href="toychr.html" />
    <link rel="prev" title="fcube" href="fcube.html" />
   
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../index.html" class="icon icon-home">
            The Logtalk Handbook
              <img src="../_static/logtalk.gif" class="logo" alt="Logo"/>
          </a>
              <div class="version">
                3.93.0
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
    
              <p class="caption" role="heading"><span class="caption-text">Contents</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../userman/index.html">User Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="../refman/index.html">Reference Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../faq/index.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devtools/index.html">Developer Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Ports</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="fcube.html"><code class="docutils literal notranslate"><span class="pre">fcube</span></code></a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#"><code class="docutils literal notranslate"><span class="pre">metagol</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#api-documentation">API documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="#loading">Loading</a></li>
<li class="toctree-l3"><a class="reference internal" href="#testing">Testing</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="toychr.html"><code class="docutils literal notranslate"><span class="pre">toychr</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../contributions/index.html">Contributions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../glossary.html">Glossary</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bibliography.html">Bibliography</a></li>
<li class="toctree-l1"><a class="reference internal" href="../genindex.html">Index</a></li>
</ul>

    <p class="caption"><span class="caption-text">External Contents</span></p>
    <ul>
    <li class="toctree-l1"><a class="reference internal" href="../../apis/index.html">APIs</a></li>
    <li class="toctree-l1"><a class="reference internal" href="https://logtalk.org">Logtalk website</a></li>
    <li class="toctree-l1"><a class="reference internal" href="https://github.com/LogtalkDotOrg/logtalk3">GitHub repo</a></li>
    </ul>
  
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">The Logtalk Handbook</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="index.html">Ports</a></li>
      <li class="breadcrumb-item active"><code class="docutils literal notranslate"><span class="pre">metagol</span></code></li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/LogtalkDotOrg/logtalk3/blob/master/docs/handbook/sources/ports/metagol.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="metagol">
<span id="library-metagol"></span><h1><code class="docutils literal notranslate"><span class="pre">metagol</span></code><a class="headerlink" href="#metagol" title="Link to this heading"></a></h1>
<p>This folder contains a Logtalk port of <code class="docutils literal notranslate"><span class="pre">metagol</span></code>, an inductive logic
programming (ILP) system based on meta-interpretive learning available
from:</p>
<div class="highlight-logtalk notranslate"><div class="highlight"><pre><span></span>https<span class="o">://</span>github.com<span class="o">/</span>metagol<span class="o">/</span>metagol
</pre></div>
</div>
<p>See the original code git repo for details and bibliography on Metagol
and ILP.</p>
<p>The port allows any number of datasets to be loaded simultaneously with
per-dataset learning options. A dataset is simply wrapped in an object
that extends and is expanded by the <code class="docutils literal notranslate"><span class="pre">metagol</span></code> object as illustrated by
the ported examples.</p>
<p>Both the original code and the port requires the coroutining <code class="docutils literal notranslate"><span class="pre">when/2</span></code>
predicate, which is only available in some backend Prolog systems. The
port currently supports ECLiPSe, XVM, SICStus Prolog, SWI-Prolog, and
YAP. It can be used on both POSIX and Windows operating-systems.</p>
<p>The examples are ported from the original Metagol distribution. Some of
the examples are taken from the following paper (with the original
Prolog examples source code files made available by MystikNinja):</p>
<div class="highlight-logtalk notranslate"><div class="highlight"><pre><span></span><span class="o">@</span>article<span class="k">{</span><span class="nv">DBLP</span><span class="o">:</span>journals<span class="o">/</span>jair<span class="o">/</span><span class="nv">EvansG18</span>,
    author    <span class="o">=</span> <span class="k">{</span><span class="nv">Richard</span> <span class="nv">Evans</span> and <span class="nv">Edward</span> <span class="nv">Grefenstette</span><span class="k">}</span>,
    title     <span class="o">=</span> <span class="k">{</span><span class="nv">Learning</span> <span class="nv">Explanatory</span> <span class="nv">Rules</span> from <span class="nv">Noisy</span> <span class="nv">Data</span><span class="k">}</span>,
    journal   <span class="o">=</span> <span class="k">{</span><span class="nv">J</span>. <span class="nv">Artif</span>. <span class="nv">Intell</span>. <span class="nv">Res</span>.<span class="k">}</span>,
    volume    <span class="o">=</span> <span class="k">{</span><span class="m">61</span><span class="k">}</span>,
    pages     <span class="o">=</span> <span class="k">{</span><span class="m">1</span><span class="o">--</span><span class="m">64</span><span class="k">}</span>,
    year      <span class="o">=</span> <span class="k">{</span><span class="m">2018</span><span class="k">}</span>,
    url       <span class="o">=</span> <span class="k">{</span>https<span class="o">://</span>doi.org<span class="o">/</span><span class="m">10.1613</span><span class="o">/</span>jair.<span class="m">5714</span><span class="k">}</span>,
    doi       <span class="o">=</span> <span class="k">{</span><span class="m">10.1613</span><span class="o">/</span>jair.<span class="m">5714</span><span class="k">}</span>,
    timestamp <span class="o">=</span> <span class="k">{</span><span class="nv">Mon</span>, <span class="m">21</span> <span class="nv">Jan</span> <span class="m">2019</span> <span class="m">15</span><span class="o">:</span><span class="m">01</span><span class="o">:</span><span class="m">17</span> <span class="o">+</span><span class="m">0100</span><span class="k">}</span>,
    biburl    <span class="o">=</span> <span class="k">{</span>https<span class="o">://</span>dblp.org<span class="o">/</span>rec<span class="o">/</span>bib<span class="o">/</span>journals<span class="o">/</span>jair<span class="o">/</span><span class="nv">EvansG18</span><span class="k">}</span>,
    bibsource <span class="o">=</span> <span class="k">{</span>dblp computer science bibliography, https<span class="o">://</span>dblp.org<span class="k">}</span>
<span class="k">}</span>
</pre></div>
</div>
<p>The paper can be downloaded at</p>
<div class="highlight-logtalk notranslate"><div class="highlight"><pre><span></span>https<span class="o">://</span>arxiv.org<span class="o">/</span>pdf<span class="o">/</span><span class="m">1711.04574</span>.pdf
</pre></div>
</div>
<p>For sample queries, please see the <code class="docutils literal notranslate"><span class="pre">SCRIPT.txt</span></code> file.</p>
<section id="api-documentation">
<h2>API documentation<a class="headerlink" href="#api-documentation" title="Link to this heading"></a></h2>
<p>Open the
<a class="reference external" href="../../apis/library_index.html#metagol">../../apis/library_index.html#metagol</a>
link in a web browser.</p>
</section>
<section id="loading">
<h2>Loading<a class="headerlink" href="#loading" title="Link to this heading"></a></h2>
<p>To load all entities in this port, load the <code class="docutils literal notranslate"><span class="pre">loader.lgt</span></code> file:</p>
<div class="highlight-logtalk notranslate"><div class="highlight"><pre><span></span>| <span class="o">?-</span> <span class="k">logtalk_load</span>(metagol(loader)).
</pre></div>
</div>
</section>
<section id="testing">
<h2>Testing<a class="headerlink" href="#testing" title="Link to this heading"></a></h2>
<p>To test this port predicates, load the <code class="docutils literal notranslate"><span class="pre">tester.lgt</span></code> file:</p>
<div class="highlight-logtalk notranslate"><div class="highlight"><pre><span></span>| <span class="o">?-</span> <span class="k">logtalk_load</span>(metagol(tester)).
</pre></div>
</div>
<p>There are three lengthy tests that only run when the tests are being run
manually instead of automatically.</p>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="fcube.html" class="btn btn-neutral float-left" title="fcube" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="toychr.html" class="btn btn-neutral float-right" title="toychr" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 1998-2025, Paulo Moura.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>